import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';

class BaseLoadingComponent extends StatelessWidget {

  BaseLoadingComponent({Key key, this.hint}) : super(key: key);

  final String hint;

  @override
  Widget build(BuildContext context) {
    Color primaryColor = Theme.of(context).primaryColor == Colors.white ? Theme.of(context).textTheme.bodyText2.color : Theme.of(context).primaryColor;
    return Material(
      color: Colors.transparent,
      child: WillPopScope(
        onWillPop: () => Future.value(true),
        child: Container(
          alignment: Alignment.center,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              SpinKitCircle(color: primaryColor, size: 26.0),
              Text(hint ?? '', style: TextStyle(color: primaryColor)),
            ],
          ),
        ),
      ),
    );
  }

}
